// components/firework/firework.js
const config = require('../../config/config');
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    imgUrls:{
      type: Array,
      value: [],
    },
    text: {
      type: String,
      value: '',
    },
    video:{
      type: String,
      value: '',
    },
    muted: {
      type: Boolean,
      value: false,
    },
    isPreview:{
      type: Boolean,
      value: false,
    },
    wishList:{
      type: Array,
      value: false,
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    isAllScreen: config.isAllScreen,
    wishcss: 'wish-common',
    current: 0
  },

  /**
   * 组件的方法列表
   */
  methods: {
    swiperChange(e){
      this.setData({
        current: e.detail.current   //获取当前轮播图片的下标
      })
    },
    imageChange(e){
      this.setData({
        current: e.currentTarget.dataset.index
      })
    },
    make(){
      this.triggerEvent('make',this.data.current);
    },
    wish(){
      this.setData({
        wishcss:'show-wish'
      })
    },
    choose(e){
      this.triggerEvent('choose',e.detail);
      this.setData({
        wishcss: 'hide-wish',
      })
    },
    next() {
      this.triggerEvent('next');
    },
    pre() {
      this.triggerEvent('pre');
    }
  }
})
